import Vue from 'vue'
import Router from 'vue-router'
import home from '@/components/home'
import list from '@/components/list'
import set from '@/components/set'
import person from '@/components/set/person'
import address from '@/components/set/address'
import detail from '@/components/detail'
import left from '@/components/set/left'
import right from '@/components/set/right'
import defaultCom from '@/components/set/defaultCom'

Vue.use(Router)

export default new Router({
  routes: [
    {
        path: '/',
        redirect:'/home'
    },
    {
        path: '/home',
        alias: '/b',  //起别名
        name: 'home',
        component: home
    },
    {
        path:'/list',
        name:'list',
        component:list
    },
    {
        path:'/set',
        name:'set',
        component:set,
        children:[
            {
                path:'/set/person',
                components:{  //components:object
                    lCom:left,
                    rCom:right
                }
            }
        ]
    },
    {
        path:'/detail/:id',
        name:'detail',
        component:detail
    }
  ]
})
